<?php
namespace Admin\Action;
use Common\Action\AdminbaseAction;

/**
 * 后台语言包生成
 */
class LanguageAction extends AdminbaseAction{
	
	protected $options_obj;
	
	public function _initialize() {
		parent::_initialize();
		$this->options_obj = D("Options");
	}

	public function activeLang(){
		$option=$this->options_obj->where("option_name='language_option'")->find();
		$lang_opts = array();
		if(!empty($option)){
			$lang_opts = json_decode($option['option_value'], true);

			// 修改默认语言的配置
			$lang_list = C('LANG_LIST') ? C('LANG_LIST') : array('zh-cn');
			$this->assign('lang_list',$lang_list);

		}

		// 获取语言列表数据库
		$languages = M("language");
		$list_lang = $languages->order('sort desc')->select();
		$this->assign('list_lang',$list_lang);

		$this->display();
	}

	public function setAttr(){
		echo 12313124152352;
	}
	
	
	
	
}